package com.example.demo6.ui.lose;

import android.app.Application;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.example.demo6.Account;
import com.example.demo6.SQLite.LostGoods;
import com.example.demo6.SQLite.MyDatabase;

import java.util.List;

public class LoseViewModel extends AndroidViewModel {
    private MyDatabase myDatabase;
    private LiveData<List<LostGoods>> listLiveData;

    public LoseViewModel(@NonNull Application application) {
        super(application);
        myDatabase = MyDatabase.getInstance(application);
        listLiveData = myDatabase.lostGoodsDao().getLostGoods();
    }
    // TODO: Implement the ViewModel

    public LiveData<List<LostGoods>> getlistLiveData()
    {
        return listLiveData;
    }
}